package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.user.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * @Author:篍
 * @Date: 2025/08/29 21:07
 * @Description:
 */
@RestController
@RequestMapping("/user/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    /**
     * 获取预计送达时间
     * @param shopId
     * @param customerAddress
     * @return
     */
    @GetMapping("/getEstimatedDeliveryTime")
    public Result<LocalDateTime> getEstimatedDeliveryTime(@RequestParam Long shopId,@RequestParam String customerAddress) {
        LocalDateTime estimatedDeliveryTime = orderService.getEstimatedDeliveryTime(shopId, customerAddress);
        return Result.success(estimatedDeliveryTime);
    }
}
